import React, { Component } from 'react';
import { inject, observer } from 'mobx-react'
import Head from 'components/Head';
import { CountPane, ContextPane, RefPane } from './hook'
import './index.less'

const prefixCls = `Car`

@inject(stores => {
  const { carStore } = stores
  const { brand, title, changeCarData } = carStore
  return {
    brand,
    title,
    changeCarData,
  }
})

@observer
class Hook extends Component {

  componentDidMount() {
    this.props.changeCarData()
    console.log("id", this.props.match.params.id)
  }

  render() {
    return (
      <>
        <Head></Head>
        <div className={prefixCls}>
          这里是HOOK示例
           <hr />
          <CountPane />
          <hr />
          <ContextPane />
          <hr />
          <RefPane />
        </div>
      </>
    )
  }
}

export default Hook